import React, {Component} from "react";
import {
  View, 
  Text, 
  ScrollView,
} from "react-native";
import {StackNavigator, TabNavigator} from "react-navigation";

import Register from "./containers/register";
import IndexPage from "./containers/IndexPage";
import ShoppingMall from "./containers/ShoppingMall";
import PersonalCenter from "./containers/PersonalCenter";
import ShoppingIndex from "./page/shoppingIndex";
import HealthEdu from "./page/healthEdu";

const TabContainer = TabNavigator(
  {
    IndexPage: {
      screen: IndexPage,
    },
    ShoppingMall: {
      screen: ShoppingMall,
    },
    PersonalCenter: {
      screen: PersonalCenter,
    }
  },
  {
    lazy: true,
    tabBarPosition: "bottom",
    swipeEnabled: false,
    animationEnabled: true,
    tabBarOptions: {
      activeTintColor: "#3CFF61",
      inactiveTintColor: "#525252",
      scrollEnabled: false,
      showIcon: true,
      indicatorStyle: {
        height: 0,
      },
      style: {
        backgroundColor: "#fff",
      }
    }
  }
)

const App = StackNavigator(
  {
    //御易健首页；
    Home: {
      screen: TabContainer,
      navigationOptions: {
        headerLeft: null,
        headerStyle: {
          backgroundColor: "#e1e1e1",
        },
      }
    },
    //商城
    shoppingIndex: {
      screen: ShoppingIndex,
    },
    //健康教育；
    healthEdu: {
      screen: HealthEdu,
    }
  }
)

export default App;